<template>
  <svg class="icon" aria-hidden="true">
    <use :xlink:href="symbolId" />
  </svg>
</template>

<script setup>
import { computed } from 'vue'

const props = defineProps({
  prefix: {
    type: String,
    default: '#icon'
  },
  name: {
    type: String,
    required: true
  }
})

const symbolId = computed(() => {
  return `${props.prefix}-${props.name}`
})
</script>

<style scoped>
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
</style>